import {mainEchart} from '../index';


export default class pieCircleTemplate extends mainEchart {
    defaultOption = {
        color: ['red'],
        title: {
            left: 'center',
            top: 'center'
        },
        angleAxis: {
            startAngle: 90,//起始角度
            clockwise: true, //true为顺时针，false为逆时针
            max: 100,//圆圈为转满一圈的值为100
            axisLine: {
                show: false
            },
            axisTick: {
                show: false
            },
            axisLabel: {
                show: false
            },
            splitLine: {
                show: false
            }
        },
        radiusAxis: {
            type: 'category',
            axisLine: {
                show: false
            },
            axisTick: {
                show: false
            },
            axisLabel: {
                show: false
            },
            splitLine: {
                show: false
            }
        },
        polar: {
            center: ['center', 'center'],
            radius: ['0%', '100%']
        },
        series: {
            type: 'bar',
            legendHoverLink: true,//开启高亮
            coordinateSystem: 'polar',
            showBackground: true,//开启柱条的背景颜色
            backgroundStyle: { //柱条背景配置
                color: '#1F3049'
            },
            roundCap: true,//圆润的头尾
            barWidth: 100,//与polar的readius共同操作边框大小
            barGap: '-100%',
            z: 20,
        },
    }

    constructor(option) {
        super(option);
        if (option.center) {
            this.defaultOption.polar.center = option.center
        }
        if (option.radius) {
            this.defaultOption.polar.radius = option.radius
        }
    }
}